import {http, native} from "@/service/http";


/**
 * 访问图片请求内容
 * @param content
 */
export const uploadImage = (content: string) => {
  return http({
    method: "POST",
    url: '/Img',
    data: content
  })
}


/**
 * 修改图片
 * @param id 图片id
 * @param content 图片内容
 */
export const updateImage = (id: string | number, content: string) => {
  return http({
    method: "PUT",
    url: `/Img/${id}`,
    data: content
  })
}


/**
 * 删除图片
 * @param id 图片id
 */
export const deleteImg = (id: string | number) => {
  return http({
    method: "DELETE",
    url: `/Img/${id}`,
  })
}


/**
 * filename
 * @param filename 图片id
 */
export const downImageBmd = (filename: string) => {
  return native({
    method: "GET",
    url: `/image/Down/Bmd`,
    params: {
      filename
    }
  })
}


/**
 * filename
 * @param filename 图片id
 */
export const downImagePic = (filename: string) => {
  return native({
    method: "GET",
    url: `/image/Down/Pic`,
    params: {
      filename
    }
  })
}


/**
 * filename
 * @param Files 图片id
 * @param Foo 图片id
 */
export const imagesUploadPic = (Files: any[], Foo: string = '') => {
  return native({
    method: "POST",
    url: `/image/Upload/Pic`,
    data: {
      Files, Foo
    }
  })
}
